package com.imooc.ad.dao;

import com.imooc.ad.entity.AdPlan;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * 广告计划操作接口
 * Created by lzq on 2019/3/1
 */
public interface AdPlanRepository extends JpaRepository<AdPlan, Long> {

    /**
     * 根据用户id和广告计划id查找广告计划
     * @param id
     * @param userid
     * @return
     */
    AdPlan findByIdAndUserId(Long id,Long userid);

    AdPlan findByUserIdAndPlanName(Long userId, String planName);

    List<AdPlan> findAllByPlanStatus(Integer status);

    List<AdPlan> findAllByIdInAndUserId(List<Long> ids, Long userId);

}
